#include <cstdio>
typedef long long ll;
const int N = 10010, mod = 1000000007;
ll n, k, a;
ll f[N][N];

inline ll pow(ll base, ll index) {
	ll res = 1;
	while (index) {
		if (index & 1) res = res * base % mod;
		base = base * base % mod;
		index >>= 1;
	}
	return res;
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
	freopen("testdata.in", "r", stdin);
	freopen("testdata.out", "w", stdout);
#endif
#ifndef LOCAL
	freopen("alpha.in", "r", stdin);
	freopen("alpha.out", "w", stdout);
#endif
#endif

	scanf("%lld%lld%lld", &k, &n, &a);
	f[k][n + 1] = 1;
	for (int i = k; ~i; --i) {
		for (int j = n; j; --j) { f[i][j] = (f[i + 1][j] + f[i][j + 1]) % mod; }
	}
	ll ans = 0;
	for (int i = 0; i <= k; ++i) { ans = (ans + f[i][1] * pow(a, i)) % mod; }
	printf("%lld", ans);
	fclose(stdin);
	fclose(stdout);
	return 0;
}